﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GuiClient.DTO;
using System.Data.OleDb;

namespace GuiClient.DAO
{
    class GiaoDichChuyenKhoanDAO:DataProvider
    {
        public void ThemGiaoDichChuyenKhoan(GiaoDichChuyenKhoanDTO giaoDich)
        {

            connect();
            this.command = connection.CreateCommand();
            command.CommandText = "INSERT INTO GIAODICHCHUYENKHOAN(MaTheGui,MaTheNhan,SoTienGui,ThoiGianGiaoDich) VALUES(@MaTheGui,@MaTheNhan,@SoTienGui,@ThoiGianGiaoDich)";
            OleDbParameter para = command.Parameters.Add("@MaTheGui", OleDbType.VarWChar);
            para.Value = giaoDich.MaTheGui;

            para = command.Parameters.Add("@MaTheNhan", OleDbType.VarWChar);
            para.Value = giaoDich.MaTheNhan;

            para = command.Parameters.Add("@SoTienGui", OleDbType.Double);
            para.Value = giaoDich.SoTien;

            para = command.Parameters.Add("@ThoiGianGiaoDich", OleDbType.VarWChar);
            para.Value = giaoDich.ThoiGianGiaoDich.ToString();

            command.ExecuteNonQuery();

        }
    }
}
